import request from '@/utils/request'

// 查询账单列表
export function listAccountEntryList(query) {
  return request({
    url: '/financialManagement/accountEntryList/list',
    method: 'get',
    params: query
  })
}

// 查询账单详细
export function getAccountEntryList(id) {
  return request({
    url: '/financialManagement/accountEntryList/' + id,
    method: 'get'
  })
}

// 新增账单
export function addAccountEntryList(data) {
  return request({
    url: '/financialManagement/accountEntryList',
    method: 'post',
    data: data
  })
}
//新增级联账单
export function addAccountEntryListDetail(data) {
  return request({
    url: '/financialManagement/accountEntryList/withDetails',
    method: 'post',
    data: data
  })
}
// 新增月费账单
export function addMonthAccountEntryListDetail(data) {
  return request({
    url: '/financialManagement/accountEntryList/addBillWithDetails',
    method: 'post',
    data: data
  })
}
// 修改账单
export function updateAccountEntryList(data) {
  return request({
    url: '/financialManagement/accountEntryList',
    method: 'put',
    data: data
  })
}

// 删除账单
export function delAccountEntryList(id) {
  return request({
    url: '/financialManagement/accountEntryList/' + id,
    method: 'delete'
  })
}

// 根据老人ID查询账单列表
export function listBillByElderlyId(elderlyId) {
  return request({
    url: `/financialManagement/accountEntryList/listByElderlyId/${elderlyId}`,
    method: 'get'
  })
}
